<template>
    <div>
        <HistoryItem
            v-for="history in data"
            :key="history.code"
            :history="history"
            @click.native="goToDetail('/detail?code='+history.code)" >
        </HistoryItem>
    </div>
<!--    //历史记录-->
</template>

<script lang="ts">
    import {Component, Vue, Provide, Prop} from "vue-property-decorator"
    import HistoryItem from '@/pages/home/components/HistoryItem.vue'
    import TitleBar from "@/pages/common/TitleBar.vue";
    import Carousel from "@/pages/common/Carousel.vue";

    @Component({
        components:{
            HistoryItem,
            TitleBar,
            Carousel
        }
    })
    export default class HistoryList extends Vue{
        @Prop({
            type: Array,
            default: function(): Array<Record<string, any>> {return [];}
        })
        data!: Array<Record<string, any>> ;

        goToDetail(path?: any){
            //name=code
            // /detail?code=123
            this.$router.push(path);
        }
    }
</script>

<style scoped>

</style>